package com.example.sample.Infrastructure.Thread;

import lombok.Synchronized;

import java.util.concurrent.locks.Lock;

public class TestThread extends Thread {

    private Thread thread;
    private static int num =0;

    @Override
    public void run() {
        System.out.println("我执行了Thread" + Thread.currentThread().getName() + "num:"+num);
    }



    public void start() {
        if (thread == null) {
            thread = new Thread(this);
            thread.setName("德玛西亚");
            thread.setPriority(10);
            thread.start();
        }
    }
}
